<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
    String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String wsPath = "ws://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<title>新建物料</title>
<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/style.css" />
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/form.css" />
<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/list.css" />
<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/jquery-ui.css" />
<script type="text/javascript">
var wsPath = '<%=wsPath%>';
path = "<%=basePath%>";
</script>
</head>
<body>
    <!-- 蓝色背景区域 -->
    <div class="wrap">
        <!-- 白色可用区域 -->
        <div class="canuse">
            <!------ 位置 ------>
            <c:choose>
                <c:when test="${materialCode==null}">
                    <p class="contentText local"><span>位置：物料信息管理 > 添加物料信息</span></p>
                </c:when>
                <c:otherwise>
                    <p class="contentText local"><span>位置：物料信息管理 > 修改物料信息</span></p>
                </c:otherwise>
            </c:choose>
            <div class="article_list" >
                <!------- 内容 ------->
                <div class="content content1" style="width: 99.6%; margin: 0px auto;">
                    <!-- 用户列表内容区 -->
                    <div class="con con_01">
                        <!-- 表单信息填写区 -->
                        <h4 class="sel_title" style="width:100%;">
                            <img src="<%=basePath%>/img/list/brand1.png" /><span>填写物料信息</span><span class="necessary" >（带*号为必填项）</span>
                        </h4>
                        <div class="write_area">
                           <c:choose>
                                <c:when test="${materialCode==null}">
                                    <form id="materialForm" action="materialBaseInfo/materialAdd" method="post">
                                </c:when>
                                <c:otherwise>
                                    <form id="materialForm" action="materialBaseInfo/materialUpdate" method="post">
                                    <input name="materialCode" type="hidden" value="${material.materialCode}">
                                </c:otherwise>
                            </c:choose>
                                <table class="contentText" border="1" cellspacing="0" cellpadding="0" width="99%">
                                    <tbody>
                                       <tr>
	                                        <th>所属型号阶段：</th>
	                                        <td>
	                                        	<input id="" name="stage" type="text" value="${material.stage}">
	                                        </td>
	                                        <th>图号：</th>
	                                        <td>
	                                        	<input id="" name="graphNumber" type="text" value="${material.graphNumber }">
	                                        </td>
											<th>批次号：</th>
	                                        <td>
	                                        	<input type="text" name="batchNo" id="" value="${material.batchNo }" />
	                                        </td>
	                                        
	                                   </tr>
                                       <tr>
                                            <th>单机名称：</th>
                                            <td><input id="materialName" name="materialName" value="${material.materialName}"> <span class="redColor">*</span></td>
                                            <th>单机代号：</th>
                                            <c:choose>
                                                <c:when test="${material.materialCode==null}">
                                                    <td><input type="text" id="materialCode" name="materialCode" value="" /><span class="redColor">*</span></td>
                                                </c:when>
                                                <c:otherwise>
                                                    <td><input type="text" id="materialCode" name="materialCode" value="${material.materialCode}" readOnly/><span class="redColor">*</span></td>
                                                </c:otherwise>
                                            </c:choose>
                                            <th>数量：</th>
	                                        <td>
	                                        	<input type="text" name="nums" id="nums" value="${material.nums }" /> <span class="redColor">*</span>
	                                        </td>
                                        </tr>
                                        <tr>
	                                    	<th>RFID卡号：</th>
	                                        <td colspan="3">
	                                        	<c:choose>
                                        		<c:when test="${not empty material.materialCode && !(material.materialCode eq null) }">
		                                        	<input type="text" name="rfidCardNumber" id="rfidCardNumber" value="${material.rfidCardNumber }" style="width:60%;"/>
													<c:if test="${material.rfidCardNumber != null and material.rfidCardNumber != ''}">
														<a id="deleteCard" class="bgd_blue_two img_hand contentText" onclick="MaterialAdd.deleteRfid('${material.materialCode }')">解绑</a>
														<a id="bindCard" class="bgd_blue_two img_hand contentText" onclick="MaterialAdd.bindRfid('${material.materialCode }')" style="display:none;">绑定</a>
													</c:if>
													<c:if test="${material.rfidCardNumber == null or material.rfidCardNumber == ''}">
														<a id="deleteCard" class="bgd_blue_two img_hand contentText" onclick="MaterialAdd.deleteRfid('${material.materialCode }')" style="display:none;">解绑</a>
														<a id="bindCard" class="bgd_blue_two img_hand contentText" onclick="MaterialAdd.bindRfid('${material.materialCode }')">绑定</a>
													</c:if>
												</c:when>
												<c:otherwise>
		                                        	<input type="text" name="rfidCardNumber" id="rfidCardNumber" value="" />
												</c:otherwise>
												</c:choose>
	                                        </td>
											
										</tr>
                                        <tr>
                                            <th>备注：</th>
                                            <td colspan="5"><textarea style="width: 95%; height: 100px;" name="remark">${material.remark}</textarea>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </form>
                            <!-- 保存、重置按钮区 -->
                            <div align="center" class="btn_submit">
                                <a class="bgd_blue_two img_hand contentText" onclick="MaterialAdd.addMaterial()">确定</a>
                                <a class="bgd_white_two img_hand" href='<%=basePath%>materialBaseInfo/toMaterialBaseInfoJsp'> 返回 </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 版尾  -->
    <div class="ending">Copyright© 2019-2020 磐基技术有限公司</div>
</body>
<script src="<%=basePath%>/js/3rd/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=basePath%>/js/3rd/jquery-ui.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=basePath%>/js/3rd/jquery.validate.js" type="text/javascript" ></script>
<script src="<%=basePath%>/js/common/common.js" type="text/javascript"></script>
<script src="<%=basePath%>js/frame/common.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=basePath%>/js/basicInfoManagement/materialAdd.js" type="text/javascript" charset="utf-8"></script>
</html>
